/**
 * 个人中心
 * 
 * @author 杨斌
 * @since 2019-05-19
 */
import common from './common'
import store from './store'

var ApiList = {};

//API 接口

/**
 * 个人中心信息
 */
ApiList.getUserInfo = function (uid, okCb, failCb) {
  var p = {
    uid
  }
  common.Api('/user_center/index', p, okCb, failCb)
}


/**
 * 我的邀请
 */
ApiList.getFansLists = function (uid, p, okCb, failCb) {
  var p = {
    uid,
    p
  }
  common.Api('/user_center/fans_list', p, okCb, failCb)
}

/**
 * 是否提交过分红申请
 */
ApiList.getUserIsFenHong = function (uid, okCb, failCb) {
  var p = {
    uid,
  }
  common.Api('/user_center/is_fenhong', p, okCb, failCb)
}

/**
 * 水票使用记录
 */
ApiList.getTicketUsedRecord = function (uid, p, okCb, failCb) {
  var p = {
    uid,
    p
  }
  common.Api('/user_center/ticketUsedList', p, okCb, failCb)
}

/**
 * 水票系统赠送记录
 */
ApiList.getSystemGive = function (uid, p, okCb, failCb) {
  var p = {
    uid,
    p
  }
  common.Api('/user_center/system_give', p, okCb, failCb)
}


/**
 * 
 */
ApiList.getTicketUsedRecord = function (uid, p, okCb, failCb) {
  var p = {
    uid,
    p
  }
  common.Api('/user_center/ticketUsedList', p, okCb, failCb)
}

/**
 * 购票记录
 */
ApiList.getTicketList = function (uid, p, okCb, failCb) {
  var p = {
    uid,
    p
  }
  common.Api('/user_center/ticket_list', p, okCb, failCb)
}

/**
 * 押金
 */
ApiList.getDeposit = function (okCb, failCb) {
  var p = {}
  common.Api('/index/ya', p, okCb, failCb)
}

/**
 * 水站
 */
ApiList.getStationList = function (address_id, okCb, failCb) {
  var p = {
    address_id
  }
  common.Api('/user_address/getZhan', p, okCb, failCb)
}


/**
 * 上传
 */
ApiList.Upload = function (uid, file, okCb, failCb) {
  var p = {
    uid,
    file
  }
  common.Api('/user_center/upload', p, okCb, failCb)
}

/**
 * 入股规则
 */
ApiList.getProfitRule = function (okCb, failCb) {
  var p = {

  }
  common.Api('/about/rule', p, okCb, failCb)
}

/**
 * 关于我们
 */
ApiList.getAboutUs = function (okCb, failCb) {
  var p = {

  }
  common.Api('/about/about_us', p, okCb, failCb)
}


/**
 * 分红申请
 */
ApiList.applyProfit = function (uid, name, mobile, invite_code, remarks, okCb, failCb) {
  var p = {
    uid,
    name,
    mobile,
    invite_code,
    remarks,
  }
  common.Api('/user_center/fenhong', p, okCb, failCb)
}

/**
 * 申请开票
 */
ApiList.buyRecordApply = function (uid, order_sn, taitou, shuihao, name, mobile, province_id, city_id, dist_id, street, okCb, failCb) {
  var p = {
    uid,
    order_sn,
    taitou,
    shuihao,
    name,
    mobile,
    province_id,
    city_id,
    dist_id,
    street,
  }
  common.Api('/order/kaipiao', p, okCb, failCb)
}

/**
 * 消息详情
 */
ApiList.getMessageDetail = function (uid, id, okCb, failCb) {
  var p = {
    uid,
    id,
  }
  common.Api('/user_center/msg_box_item', p, okCb, failCb)
}

/**
 * 删除消息
 */
ApiList.deleteMessage = function (id, okCb, failCb) {
  var p = {
    id,
  }
  common.Api('/user_center/msg_box_del', p, okCb, failCb)
}

/**
 * 联系电话
 */
ApiList.getMobile = function (okCb, failCb) {
  var p = {

  }
  common.Api('/index/company_mobile', p, okCb, failCb)
}

/**
 * 修改昵称
 */
ApiList.edirNickname = function (uid, nickname,okCb, failCb) {
  var p = {
    uid,
    nickname
  }
  common.Api('/user_center/userinfo_submit', p, okCb, failCb)
}

/**
 * 删除购票记录
 */
ApiList.delBuyRecordTicket = function (id,okCb, failCb) {
  var p = {
    id,
  }
  common.Api('/user_center/ticket_del', p, okCb, failCb)
}

/**
 * 删除购票记录
 */
ApiList.getBuyRecordTicketInfo = function (id,okCb, failCb) {
  var p = {
    id,
  }
  common.Api('/user_center/ticket_info', p, okCb, failCb)
}




export default ApiList;
